<?php include 'admin-css-js.php'; ?>

<div id="wrapper">
    <div id="container">
        <div id="header"> <!-- Header -->
            <div id="title">
                Globe Digital
                <span>Công ty CP đầu tư thương mại Globe</span>
            </div>
            <div class="logged">
                <p>Xin chào, <a href="<?php echo $root_page; ?>/quanly/logout/" title="<?php echo $loginName; ?>"><?php echo $loginName; ?></a>!</p>
                <div class="user-online" style="padding: 10px 0;">
                    <p>Tổng số lượt truy cập: <span id="total-views"></span></p>
                    <p>Đang xem: <span id="current-online"></span><span><a onclick="AdminController.getUserOnline();"><img src="/public/images/blackadmin/loader2.gif" style="vertical-align: middle;margin-left: 10px;cursor: pointer"></a></span></p>
                </div>
            </div>
        </div>
        <div id="mainpage">

            <div id="leftandcenter">

                <div id="maincontentcenter">
                    <div id="main"> <!-- Main, right side content -->
                        <div id="content"> <!-- Content begins here -->


                            <div id="maincontentcenter" class="content-box">
                                <div class="content-box-header">
                                    <div id="manage-new-pland"></div>
                                </div>

                                <div class="content-box-content">
                                    <div id="list-content-category" class="hide">
                                        <div id="list_cat_0"></div>
                                        <div id="list_cat_1"></div>
                                        <div id="list_cat_2"></div>
                                        <div id="list_cat_3"></div>
                                        <div id="list_cat_4"></div>
                                    </div>
                                    <div id="add-new-category" class="hide">
                                        <?php include 'editor-add-sub-category.php'; ?>
                                    </div>
                                    <div id="merge_category" class="hide"></div>
                                    <div id="show-add-sub-cat" class="hide"></div>
                                    <div id="list-sub-cat" class="hide"></div>
                                    <div id="list-product" class="hide"></div>
                                    <input type="hidden" name="list_product_order_id" id="list_product_order_id">
                                    <div id="list-news" class="hide"></div>
                                    <div id="editor" class="hide">
                                        <?php include 'editor-add-product.php' ?>
                                    </div>
                                    <div id="editor-add-news" class="hide">
                                        <?php include 'editor-add-news.php' ?>
                                    </div>
                                    <div id="editor-edit-category-content" class="hide" style="clear: both;">
                                        <?php include 'editor-edit-category-content.php'; ?>
                                    </div>
                                    <div id="list-news-category" class="hide">
                                        <div id="news_cat_item_0"></div>
                                        <div id="news_cat_item_1"></div>
                                        <div id="news_cat_item_2"></div>
                                        <div class="clear"></div>
                                        <div id="product_cat_option"></div>
                                    </div>
                                    <div id="addCategoryNews" class="hide"></div>
                                    <div id="list_member" class="hide"></div>
                                    <div id="form_add_member" class="hide">
                                        <?php include 'editor-add-member.php'; ?>
                                    </div>
                                    <div id="list-product-maker" class="hide"></div>
                                    <div id="manageOrder" class="hide">
                                        <?php include 'editor-search-order.php';?>
                                        <div style="height: 10px;width: 100%;"></div>
                                        <div id="list_order_content" class="hide"></div>
                                    </div>
                                    <div id="view_detail_order" class="hide"></div>
                                    <div id="list_slider" class="hide"></div>
                                    <div id="form_add_slider" class="hide">
                                        <?php include 'editor-add-slider.php'; ?>
                                    </div>
                                    <div id="manage_curency" class="hide">
                                        <form name="frmManageCurrency" id="frmManageCurrency" onsubmit="AdminController.saveCurrency(); return false;">
                                            Tỷ giá hiện tại<input class="w250p" type="text" name="common_currency" id="common_currency">
                                            <input type="submit" class="submit" value="Cập nhật"">
                                        </form>
                                    </div>
                                    <div id="list_support_online" class="hide"></div>
                                    <div id="frm_add_support_online" class="hide">
                                        <?php include 'editor_add_support_online.php'; ?>
                                    </div>
                                    <div id="customer_link" class="hide"></div>
                                    <div id="customer_contact" class="hide"></div>
                                    <div id="customer_link_detail" class="hide"></div>
                                    <div id="customer_list_customer" class="hide"></div>
                                    <div id="ctv_list_my_ctv" class="hide"></div>
                                    <div id="ctv_view_detail" class="hide"></div>
                                    <div id="customer_list_CTV" class="hide"></div>
                                    <div id="editor_add_my_ctv" class="hide">
                                        <?php include 'ctv_form_add_my_ctv.php'; ?>
                                    </div>
                                    <div id="kd_list_my_profit" class="hide"></div>
                                    <div id="kd_list_my_product" class="hide"></div>
                                    <div id="kd_view_detail_my_product" class="hide"></div>
                                    <div id="kd_add_my_product" class="hide">
                                        <?php include 'kd_add_my_product.php'; ?>
                                    </div>
                                    <div id="add_new_product_order" class="hide">

                                    </div>
                                    <div id="kd_list_my_customer" class="hide"></div>
                                    <div id="change_pasword" class="hide">
                                        <form id="frmChangePass" name="frmChangePass">
                                            <table cellpadding="0" cellspacing="0" width="100%">
                                                <col width="30%">
                                                <col width="70%">
                                                <tr>
                                                    <td>
                                                        Nhập mật khẩu cũ
                                                    </td>
                                                    <td>
                                                        <input type="password" name="member_old_pass" id="member_old_pass" class="w200p">
                                                        <span id="member_old_pass_error" class="validate_error" style="display: none;"></span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Nhập mật khẩu mới
                                                    </td>
                                                    <td>
                                                        <input type="password" name="member_new_pass" id="member_new_pass" class="w200p">
                                                        <span id="member_new_pass_error" class="validate_error" style="display: none;"></span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        Nhập lại mật khẩu mới
                                                    </td>
                                                    <td>
                                                        <input type="password" name="member_retype_new_pass" id="member_retype_new_pass" class="w200p">
                                                        <span id="member_retype_new_pass_error" class="validate_error" style="display: none;"></span>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        <div style="padding-top: 10px;">
                                                            <input type="button" value="Đổi mật khẩu" class="cpointer submit" onclick="AdminController.savePassword();">
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>
                                    </div>
                                    <div id="list-introduction" class="hide"></div>
                                    <div id="manageIntroduction" class="hide">
                                        <?php include 'editor_add_introduction.php'; ?>
                                    </div>
                                    <div id="frm-add-home-keyword" class="hide">
                                        <?php include 'editor_edit_keyword.php';?>
                                    </div>
                                    <div id="frm-add-page-info" class="hide">
                                        <?php include 'editor_add_page_info.php';?>
                                    </div>
                                </div>

                            </div>
                            <div class="clear"> </div>

                            <!-- Paginator end -->
                        </div> <!-- END Content -->

                    </div>
                </div>

                <div id="left">
                    <div style="width:230px;text-align:center;position: absolute;left: 0px; top: 15px;">
                        <label for="auto" class="cpointer"><input type=radio id="auto" value="1" name="typer" onclick="return Mudim.SetMethod(4);" checked="checked"><span class=AVIMControl>Tự động</span></label>
                        <label for="telext" class="cpointer"><input type=radio id="telext" value="1" name="typer" onclick="return Mudim.SetMethod(2);"><span class=AVIMControl>TELEX</span></label>
                        <label for="vni" class="cpointer"><input type=radio id="vni" value="1" name="typer" onclick="return Mudim.SetMethod(1);"><span class=AVIMControl>VNI</span></label>
                        <label for="off" class="cpointer"><input type=radio id="off" value="1" name="typer" onclick="return Mudim.SetMethod(0);"><span class=AVIMControl>Tắt</span></label>
                    </div>
                    <div id="sidebar"> 
                        <div class="sidebox">
                            <span class="stitle" id="left-header">Danh Mục</span>
                            <!-- Navigation begins here -->
                            <div id="navigation">
                                <div class="sidenav">
                                    <div class="navhead" onclick="AdminController.manageProduct();"><span>Sản phẩm</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <?php if ($perProduct != '' || $isMaster == 1) {
                                                ?>
                                                <li>
                                                    <a class="cpointer noselect" id="menu_1" onclick="AdminController.getListProduct();">Danh sách sản phẩm</a>
                                                </li>
                                            <?php } ?>

                                            <?php if ($permissionProductCategory != '' || $isMaster == 1) { ?>
                                                <li><a class="cpointer noselect" id="menu_2" onclick="AdminController.manageCategory();">Danh mục sản phẩm</a></li>
                                            <?php } ?>

                                            <?php if ($permissionProductSpecs != '' || $isMaster == 1) { ?>
                                                <li><a class="cpointer noselect" id="menu_2" onclick="AdminController.manageSpecs();">Thông số kỹ thuật</a></li>
                                            <?php } ?>

                                            <?php if ($perProductMaker != '' || $isMaster == 1) { ?>
                                                <li><a class="cpointer noselect" id="menu_3" onclick="AdminController.manageProductMaker();">Hãng sản xuất</a></li>
                                            <?php } ?>
                                        </ul>
                                    </div>

                                    <div class="navhead" onclick="AdminController.manageNews();"><span>Tin tức</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <?php if ($permissionNews != '' || $isMaster == 1) { ?>
                                                <li><a class="cpointer noselect"  id="menu_3" onclick="AdminController.getListNews();">Danh sách tin tức</a></li>
                                            <?php } ?>
                                            <?php if ($permissionNewsCategory != '' || $isMaster == 1) { ?>
                                                <li><a class="cpointer noselect" id="menu_4" onclick="AdminController.manageNewsCategory();">Danh mục tin tức</a></li>
                                            <?php } ?>
                                        </ul>
                                    </div>
                                    <div class="navhead" onclick=""><span>Thống kê</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <li><a class="cpointer noselect" onclick="AdminController.showFormExport();">Thống kê doanh số</a></li>
                                        </ul>
                                    </div>
                                    <div class="navhead" onclick="AdminController.manageOrder();"><span>Đơn hàng</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <?php if ($permissionOrder != '' || $isMaster == 1) { ?>
                                                <li><a class="cpointer noselect" onclick="AdminController.getProductOrder('new', 1);">Đơn hàng mới</a></li>
                                                <li><a class="cpointer noselect" onclick="AdminController.getProductOrder('isProcess', 1);">Đơn hàng đã xử lý</a></li>
                                                <li><a class="cpointer noselect" onclick="AdminController.getProductOrder('isWait', 1);">Đơn hàng đang chờ xử lý</a></li>
                                            <?php } ?>
                                        </ul>
                                    </div>
                                    <?php if ($permissionProductPrice != '' || $isMaster == 1) { ?>
                                        <div class="navhead"><span>Download</span></div>
                                        <div class="subnav">
                                            <ul class="submenu">
                                                <li><a class="cpointer noselect">Danh sách file download</a></li>
                                                <li><a class="cpointer noselect">Danh mục download</a></li>
                                            </ul>
                                        </div>
                                    <?php } ?>
                                    <div class="navhead" onclick="AdminController.manageSlider();"><span>Quản lý slider</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <li><a class="cpointer noselect" onclick="AdminController.getSlider('active', 1);">Danh sách slider</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.addSlider();">Thêm slider</a></li>
                                        </ul>
                                    </div>
                                    <?php if ($isMaster == 1) { ?>
                                        <div class="navhead" onclick="AdminController.manageMember();"><span>Phân quyền</span></div>
                                        <div class="subnav">
                                            <ul class="submenu">
                                                <li><a class="cpointer noselect" onclick="AdminController.getListMember();">Danh sách thành viên</a></li>
                                            </ul>
                                        </div>
                                    <?php } ?>

                                    <div class="navhead" onclick="AdminController.manageCustomer();"><span>Quản lý khách hàng</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <!--                                        <li><a class="cpointer noselect" onclick="AdminController.getListCustomer();">Danh sách khách hàng</a></li>-->
                                            <li><a class="cpointer noselect" onclick="AdminController.getListCustomerCTV();">Danh sách cộng tác viên</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.statisticsProfit();">Thống kê doanh số</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.getMyCtv();">Cộng tác viên của tôi</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.getMyProfit();">Doanh số của tôi</a></li>
                                            <!--                                        <li><a class="cpointer noselect">Khách hàng của tôi</a></li>-->
                                            <!--                                        <li><a class="cpointer noselect">Nhà phân phối của tôi</a></li>-->
                                        </ul>
                                    </div>
                                    <div class="navhead" onclick="AdminController.manageUser();"><span>Quản lý người dùng</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <li><a class="cpointer noselect" onclick="AdminController.changePassword();">Thay đổi mật khẩu</a></li>
                                        </ul>
                                    </div>

                                    <div class="navhead" onclick="AdminController.manageCommon();"><span>Quản lý chung</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <li><a class="cpointer noselect" onclick="AdminController.manageIntroduction();">Quản lý nội dung</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.managePage();">Quản lý trang</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.manageGeneral('currency');">Tỷ giá ngoại tệ</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.manageKeyword();">Từ khóa tìm kiếm</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.getContactList('all');">Khách liên hệ</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.manageSupportOnline();">Hỗ trợ trực tuyến</a></li>
                                        </ul>
                                    </div>
                                    <div class="navhead"><span>Mặc cả thuê</span></div>
                                    <div class="subnav">
                                        <ul class="submenu">
                                            <li><a class="cpointer noselect" onclick="AdminController.showCustomerProductLink('all');">Link khách hàng</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.showCustomerProductLink();">Yêu cầu kinh doanh gọi</a></li>
                                            <li><a class="cpointer noselect" onclick="AdminController.showCustomerProductLink();">Yêu cầu gửi báo giá</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--        <div class="sidebox">
                                    <span class="stitle">Additional Panel</span>
                                    <div id="datepicker"></div>
        
                                </div>-->
                    </div>
                </div>

            </div>

        </div>

        <div id="right">
            <div class="sidebar-right">
                <div class="sidebox-right">
                    <div id="list-category"></div>
                </div>
            </div>
        </div>

        <div class="clear"></div>

        <div id="footer">
            <p>Copyright <a rel="dofollow" target="_blank" href="">Globe degital</a>Công ty CP đầu tư thương mại Globe</p>
        </div>
        <?php include 'order_overlay_update_customer.php'; ?>
        <?php include 'product_overlay_add_order.php'; ?>
        <?php include 'overlay-confirm.php'; ?>
        <?php include 'overlay-confirm-yes-no.php'; ?>
    </div>
</div>
<script type="text/javascript">
    var tooltipObj = new DHTMLgoodies_formTooltip();
    tooltipObj.setTooltipPosition('right');
    tooltipObj.setPageBgColor('#EEEEEE');
    tooltipObj.setTooltipCornerSize(10);
    tooltipObj.initFormFieldTooltip();
</script>
<script type="text/javascript">
    var perProduct = <?php echo (isset($perProduct)) ? $perProduct : "''"; ?>;
    var perProductAdd = <?php echo (isset($perProductAdd)) ? $perProductAdd : "''"; ?>;
    var perProductEdit = <?php echo (isset($perProductEdit)) ? $perProductEdit : "''"; ?>;
    var perProductDelete = <?php echo (isset($perProductDelete)) ? $perProductDelete : "''"; ?>;

    var permissionProductCategory = <?php echo (isset($permissionProductCategory)) ? $permissionProductCategory : "''"; ?>;
    var perProductCategoryAdd = <?php echo (isset($perProductCategoryAdd)) ? $perProductCategoryAdd : "''"; ?>;
    var perProductCategoryEdit = <?php echo (isset($perProductCategoryEdit)) ? $perProductCategoryEdit : "''"; ?>;
    var perProductCategoryDelete = <?php echo (isset($perProductCategoryDelete)) ? $perProductCategoryDelete : "''"; ?>;

    var permissionNews = <?php echo (isset($permissionNews)) ? $permissionNews : "''"; ?>;
    var perNewsAdd = <?php echo (isset($perNewsAdd)) ? $perNewsAdd : "''"; ?>;
    var perNewsEdit = <?php echo (isset($perNewsEdit)) ? $perNewsEdit : "''"; ?>;
    var perNewsDelete = <?php echo (isset($perNewsDelete)) ? $perNewsDelete : "''"; ?>;

    var permissionNewsCategory = <?php echo (isset($permissionNewsCategory)) ? $permissionNewsCategory : "''"; ?>;
    var perNewsCategoryAdd = <?php echo (isset($perNewsCategoryAdd)) ? $perNewsCategoryAdd : "''"; ?>;
    var perNewsCategoryEdit = <?php echo (isset($perNewsCategoryEdit)) ? $perNewsCategoryEdit : "''"; ?>;
    var perNewsCategoryDelete = <?php echo (isset($perNewsCategoryDelete)) ? $perNewsCategoryDelete : "''"; ?>;

    var permissionOrder = <?php echo (isset($permissionOrder)) ? $permissionOrder : "''"; ?>;
    var perOrderEdit = <?php echo (isset($perOrderEdit)) ? $perOrderEdit : "''"; ?>;
    var perOrderDelete = <?php echo (isset($perOrderDelete)) ? $perOrderDelete : "''"; ?>;

    var perProductMaker = <?php echo (isset($perProductMaker)) ? $perProductMaker : "''"; ?>;
    var perProductMakerAdd = <?php echo (isset($perProductMakerAdd)) ? $perProductMakerAdd : "''"; ?>;
    var perProductMakerEdit = <?php echo (isset($perProductMakerEdit)) ? $perProductMakerEdit : "''"; ?>;
    var perProductMakerDelete = <?php echo (isset($perProductMakerDelete)) ? $perProductMakerDelete : "''"; ?>;

    var permissionProductSpecs = <?php echo (isset($permissionProductSpecs)) ? $permissionProductSpecs : "''"; ?>;
    var perProductSpecsAdd = <?php echo (isset($perProductSpecsAdd)) ? $perProductSpecsAdd : "''"; ?>;
    var perProductSpecsEdit = <?php echo (isset($perProductSpecsEdit)) ? $perProductSpecsEdit : "''"; ?>;
    var perProductSpecsDelete = <?php echo (isset($perProductSpecsDelete)) ? $perProductSpecsDelete : "''"; ?>;

    var permissionProductPrice = <?php echo (isset($permissionProductPrice)) ? $permissionProductPrice : "''"; ?>;
    var perProductPriceAdd = <?php echo (isset($perProductPriceAdd)) ? $perProductPriceAdd : "''"; ?>;
    var perProductPriceEdit = <?php echo (isset($perProductPriceEdit)) ? $perProductPriceEdit : "''"; ?>;
    var perProductPriceDelete = <?php echo (isset($perProductPriceDelete)) ? $perProductPriceDelete : "''"; ?>;

    var isMaster = <?php echo (isset($isMaster)) ? $isMaster : "''"; ?>
    
</script>
<script type="text/javascript">
    var ULR = '<?php echo $root_page; ?>';
</script>
<script type="text/javascript">
    $(function() {
        $('ul.submenu li a').click(function(){
            var parent = $('.submenu');
            parent.find('.current').removeClass('current');
            $(this).addClass('current');
        });

    });
    AdminController.getUserOnline();
    setInterval(function() {
      AdminController.getUserOnline();
    }, 60000);
</script>
